package ae.pcfc.etks.online.itworx.ehs.web.delegate;

import java.util.List;

import ae.pcfc.etks.online.itworx.ehs.web.entity.Comment;
import ae.pcfc.etks.online.itworx.ehs.web.enums.IMSRequestStatus;
import ae.pcfc.etks.online.itworx.ehs.web.exception.CommunicationException;
import ae.pcfc.etks.online.itworx.ehs.web.exception.IMSException;

public interface IMSDelegate extends BaseDelegate {
	/**
	 * @param inspectionCode  for current phase always it has to be "OFC"
	 * @param category  Request type one of the following "NEW","AMENDMENT
	 * @param buCode  Business Unit Code
	 * @param requestorId  Trakhees ID of the client. (From TSC System Attributes ,get the IMS Client ID)
	 * @param createdBy  Domain user name of the  Officer who is picking the request
	 * @return Log ID which is created in IMS
	 * @throws RuntimeException 
	 * @throws IMSException 
	 */
	String createIMPSRecord(String inspectionCode, String category, String buCode, String requestorId, String createdBy) throws IMSException, CommunicationException;
	
	/**
	 * @param imsLogId  Log ID to be cancelled in IMS
	 * @return In case of log cancel success, then "Y" otherwise "N"
	 * @throws RuntimeException 
	 * @throws IMSException 
	 */
	String cancelIMPSRecord(String imsLogId) throws IMSException, CommunicationException;
	
	/**
	 * @param imsLogId Log ID to get its status from IMS
	 * @return  Status may be in one of the following REINSPECTION, IN-PROGRSS or CLOSED
	 * @throws RuntimeException 
	 * @throws IMSException 
	 */
	IMSRequestStatus retrieveIMSStatus(String imsLogId) throws IMSException, CommunicationException;
	
	/**
	 * @param imsLogId Log ID to get its commenets from IMS
	 * @return list of Comments of specific logId
	 * @throws RuntimeException 
	 * @throws IMSException 
	 */
	List<Comment> retrieveIMSComments(String imsLogId) throws IMSException, CommunicationException;
	
	/**
	 * @param imsLogId
	 * @param commentsRecords
	 * @return Status  may be Y or N
	 * @throws RuntimeException 
	 * @throws IMSException 
	 */
	String setIMSCustomerReply(String imsLogId, List<Comment> commentsRecords) throws IMSException, CommunicationException;
}
